//成交金额
function sumOrder() {
    $.ajax({
        url: "sumOrderListByCompID",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumOrder").html("");
            $("#sumOrder").html(data.sumOrder + "元");
        }
    });
}

//留言
function sumPlaint() {
    $.ajax({
        url: "sumPlaintListByCompID",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumPlaint").html("");
            $("#sumPlaint").html(data.sumPlaint + "条");
        }
    });
}

//订单
function sumOrderList() {
    var data = {
        "orderState": 4
    }
    $.ajax({
        url: "sumOrderListByCompIDAndOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumOrderList").html("");
            $("#sumOrderList").html(data.sumOrderList + "笔");
        }
    });
}

//待处理
function sumOrderList_1() {
    var data = {
        "orderState": 2
    }
    $.ajax({
        url: "sumOrderListByCompIDAndOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumOrderList_1").html("");
            $("#sumOrderList_1").html(data.sumOrderList + "笔");
        }
    });
}

//申请退款
function sumOrderList_2() {
    var data = {
        "orderState": 5
    }
    $.ajax({
        url: "sumOrderListByCompIDAndOrderState",
        type: "POST",
        dataType: "json",
        data: JSON.stringify(data),
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumOrderList_2").html("");
            $("#sumOrderList_2").html(data.sumOrderList + "笔");
        }
    });
}

//统计通知
function sumInform() {
    $.ajax({
        url: "findInformByInform",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        async: false,
        success: function (data) {
            $("#sumInform").html("");
            $("#sumInform").html(data.sumInform + "条");
        }
    });
}

//输出名称
function JudgeLogin_5() {
    $.ajax({
        url: "JudgeLogin_5",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                $("#sellerNickname").append(data.sellerNickname);
            } else {
                window.location.href = "Background_index.html";
            }
        }
    });
}

//输出名称
function findRecStyleByRecStyleData() {
    $.ajax({
        url: "findRecStyleByRecStyleData",
        type: "POST",
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        success: function (data) {
            if (data.code == 200) {
                var code = '';
                for (var i = 0; i < data.recStyle_List.length; i++) {
                    code += " <li><i class=\"iconfont\">&#xe622;</i><a href=\"#\">" + (i + 1) + "." + data.recStyle_List[i].recStyName + "</a></li>";

                }
                $("#list").html("");
                $("#list").append(code);
            }
        }
    });
}

$(function () {
    sumOrder();
    sumOrderList();
    sumOrderList_1();
    sumOrderList_2();
    sumPlaint();
    sumInform();
    JudgeLogin_5();
    findRecStyleByRecStyleData();
});